/*******************************************************************************************************

Figure A5: The share of petitions for which we can identify the sender.

*******************************************************************************************************/

*Set directory path
cd "C:\Users\tsa23\Documents\petitions\replication files"

clear all
*cd N:\tsa23\AIDT\PAPERS\petitions\stata

use dta\did_rep.dta

set scheme plotplainblind

*keep ID year petitions type* 
keep ID year petitions type* 

collapse (sum) petitions (sum) type*, by(year)

egen typeall = rowtotal(type1 type2 type3 type4 type5 type6 type7)

gen typeshare = 100* typeall/petitions

graph hbar typeshare, over(year) blabel(bar, format(%2.1f)) ytitle("Share of petitions with senders (all borough constituencies)") title(" " ) yline(1830 1833)
graph export graphs\figureA5.pdf, as(pdf) name("Graph") replace